// pages/mydata/mydata.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        card:true,
        allcou:'',
        loadingcou:'',
        donecou:'',
        dynamicList:[
    //         {nickname:'测欧根尼没有桶',userImg:'https://tse4-mm.cn.bing.net/th/id/OIP.mxyGk5h00-CvuWyWI7ZKVgAAAA?w=206&h=206&c=7&o=5&dpr=1.25&pid=1.7',
    //         succession:1,sum:10,good:25,group:"坚持吃早餐",mood:"😀元气满满的一天鸭！",
    //         content:'            马修·麦康纳要竞选德州州长。突然想起他在《真探》第一季里一罐接一罐喝Lone Star的场景，从Lone Star精神代言人到真Lone Star代言人😅            ',
    //         imgList:['https://pic.baike.soso.com/p/20140116/20140116094850-899444274.jpg','https://th.bing.com/th/id/R929c6415e5bc3970957c0e1b3e6770e3?rik=3tngWTC0HXVajA&riu=http%3a%2f%2fi1.sinaimg.cn%2fent%2fs%2fu%2fhlw%2f2014-03-13%2fU8551P28T3D4111048F326DT20140313175521.jpg&ehk=RD6%2bCBpV6sx2HC%2f7d8FEsDfQHrwa8Fzbu0Y4zPmtR5I%3d&risl=&pid=ImgRaw']    
    //     },
    //     {nickname:'测欧根尼没有桶',userImg:'https://tse4-mm.cn.bing.net/th/id/OIP.mxyGk5h00-CvuWyWI7ZKVgAAAA?w=206&h=206&c=7&o=5&dpr=1.25&pid=1.7',
    //     succession:1,sum:10,good:20,group:"减肥打卡",mood:"🆒风向决定发型~",
    //     content:'            马修·麦康纳要竞选德州州长。突然想起他在《真探》第一季里一罐接一罐喝Lone Star的场景，从Lone Star精神代言人到真Lone Star代言人😅            ',
    //     imgList:['https://pic.baike.soso.com/p/20140116/20140116094850-899444274.jpg','https://th.bing.com/th/id/R929c6415e5bc3970957c0e1b3e6770e3?rik=3tngWTC0HXVajA&riu=http%3a%2f%2fi1.sinaimg.cn%2fent%2fs%2fu%2fhlw%2f2014-03-13%2fU8551P28T3D4111048F326DT20140313175521.jpg&ehk=RD6%2bCBpV6sx2HC%2f7d8FEsDfQHrwa8Fzbu0Y4zPmtR5I%3d&risl=&pid=ImgRaw']    
    // }   
]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

        var app = getApp();
        var that = this;
        wx.request({
          url: 'http://127.0.0.1:8000/getUserData?openid='+app.globalData.openid,
          success:function(res){
              console.log(res)
              var allcou = res.data.allcou;
              var loadingcou = res.data.loadingcou;
              var donecou = res.data.donecou;
              that.setData({
                allcou:allcou,
                loadingcou:loadingcou,
                donecou:donecou
              })
          }
        })
        // 获取用户发表过的动态
        wx.request({
          url: 'http://127.0.0.1:8000/getUserDynamic?openid='+app.globalData.openid,
          success:function(res){
              console.log(res)
              if(res.data.code === 'ok')
              {
                that.setData({
                  dynamicList:res.data.data
                })
              }
          }
        })
    },  

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})